<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.5"/>
<title>sysmon: xsysmon_polled_example.c File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="HTML_custom.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="xlogo_bg.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">sysmon
   </div>
   <div id="projectbrief">Vitis Drivers API Documentation</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.5 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Overview</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li><a href="globals.html"><span>APIs</span></a></li>
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="pages.html"><span>Examples</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('xsysmon__polled__example_8c.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">xsysmon_polled_example.c File Reference</div>  </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">Overview</h2>
<div class="textblock"><p>This file contains a design example using the driver functions of the System Monitor driver. </p>
<p>The example here shows the driver/device in polled mode to check the on-chip temperature and voltages.</p>
<dl class="section note"><dt>Note</dt><dd></dd></dl>
<p>The values of the on-chip temperature and the on-chip Vccaux voltage are read from the device and then the alarm thresholds are set in such a manner that the alarms occur.</p>
<pre></pre><pre>MODIFICATION HISTORY:</pre><pre>Ver   Who    Date     Changes
</p>
<hr/>
<p>
1.00a xd/sv  05/22/07 First release
2.00a sdm    09/26/08 Added code to return temperature value to the main
                function. TestappPeripheral prints the temperature
4.00a ktn    10/22/09 Updated the example to use macros that have been
                renamed to remove _m from the name of the macro.
5.03a bss    04/25/13 Modified SysMonPolledExample function to set
                Sequencer Mode as Safe mode instead of Single
                channel mode before configuring Sequencer registers.
                CR #703729
7.3   ms   01/23/17 Added xil_printf statement in main function to
                    ensure that "Successfully ran" and "Failed" strings
                    are available in all examples. This is a fix for
                    CR-965028.
7.8   cog  07/20/23 Added support for SDT flow
</pre> </div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a61263d0e8e0dcc83b57e5620d0cd4d72"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xsysmon__polled__example_8c.html#a61263d0e8e0dcc83b57e5620d0cd4d72">SysMonPolledExample</a> (u16 SysMonDeviceId, int *Temp)</td></tr>
<tr class="memdesc:a61263d0e8e0dcc83b57e5620d0cd4d72"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function runs a test on the System Monitor/ADC device using the driver APIs.  <a href="#a61263d0e8e0dcc83b57e5620d0cd4d72">More...</a><br/></td></tr>
<tr class="separator:a61263d0e8e0dcc83b57e5620d0cd4d72"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a840291bc02cba5474a4cb46a9b9566fe"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xsysmon__polled__example_8c.html#a840291bc02cba5474a4cb46a9b9566fe">main</a> (void)</td></tr>
<tr class="memdesc:a840291bc02cba5474a4cb46a9b9566fe"><td class="mdescLeft">&#160;</td><td class="mdescRight">Main function that invokes the polled example in this file.  <a href="#a840291bc02cba5474a4cb46a9b9566fe">More...</a><br/></td></tr>
<tr class="separator:a840291bc02cba5474a4cb46a9b9566fe"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="a840291bc02cba5474a4cb46a9b9566fe"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int main </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Main function that invokes the polled example in this file. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">None.</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li>XST_SUCCESS if the example has completed successfully.</li>
<li>XST_FAILURE if the example has failed.</li>
</ul>
</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

<p>References <a class="el" href="xsysmon__polled__example_8c.html#a61263d0e8e0dcc83b57e5620d0cd4d72">SysMonPolledExample()</a>.</p>

</div>
</div>
<a class="anchor" id="a61263d0e8e0dcc83b57e5620d0cd4d72"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int SysMonPolledExample </td>
          <td>(</td>
          <td class="paramtype">u16&#160;</td>
          <td class="paramname"><em>SysMonDeviceId</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&#160;</td>
          <td class="paramname"><em>Temp</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function runs a test on the System Monitor/ADC device using the driver APIs. </p>
<p>This function does the following tasks:</p>
<ul>
<li>Initiate the System Monitor device driver instance</li>
<li>Run self-test on the device</li>
<li>Setup alarms for on-chip temperature and VCCAUX</li>
<li>Setup the sequence registers to continuously monitor on-chip temperature and VCCAUX</li>
<li>Setup configuration registers to start the sequence</li>
<li>Read latest on-chip temperature and VCCAUX, as well as their maximum and minimum values. Also check if alarm(s) are set</li>
</ul>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">SysMonDeviceId</td><td>is the XPAR_&lt;SYSMON_ADC_instance&gt;_DEVICE_ID value from xparameters.h. </td></tr>
    <tr><td class="paramname">Temp</td><td>is an output parameter, it is a pointer through which the current temperature value is returned to the main function.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li>XST_SUCCESS if the example has completed successfully.</li>
<li>XST_FAILURE if the example has failed.</li>
</ul>
</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None </dd></dl>

<p>References <a class="el" href="struct_x_sys_mon___config.html#a0c21814e1533c922ccbb0a70bf60261f">XSysMon_Config::BaseAddress</a>, <a class="el" href="group___overview.html#gac40645b74aaa13f5a98f54766d9867c2">XSM_AOR_TEMP_MASK</a>, <a class="el" href="group___overview.html#ga3298749348791ea76d1e35a9a1ab1b93">XSM_AOR_VCCAUX_MASK</a>, <a class="el" href="group___overview.html#ga138ea63ae47cd1478f188045792a5aef">XSM_ATR_TEMP_LOWER</a>, <a class="el" href="group___overview.html#ga7e041ad6a624c7014aad8803d2f9667a">XSM_ATR_TEMP_UPPER</a>, <a class="el" href="group___overview.html#ga6e1a39ae23bf829dbb3eb27f95582cea">XSM_ATR_VCCAUX_LOWER</a>, <a class="el" href="group___overview.html#gaf1f02865999885b46b1b1fdd64f71098">XSM_ATR_VCCAUX_UPPER</a>, <a class="el" href="group___overview.html#ga7cd77d90e7456614726390476f3636c8">XSM_AVG_16_SAMPLES</a>, <a class="el" href="group___overview.html#ga52a6fb60ad44e0e4b95c4c54e331bc5c">XSM_CFR1_ALM_TEMP_MASK</a>, <a class="el" href="group___overview.html#ga426292488bb2aee0969e533223757104">XSM_CFR1_ALM_VCCAUX_MASK</a>, <a class="el" href="group___overview.html#gaf2f79c54dddbdf090934f80f315b2e60">XSM_CH_TEMP</a>, <a class="el" href="group___overview.html#ga1c6a2517306958c69f3259057d3649a9">XSM_CH_VCCAUX</a>, <a class="el" href="group___overview.html#ga35d9814abedb2943f4a84ecff66351e5">XSM_MAX_TEMP</a>, <a class="el" href="group___overview.html#ga0318391019767d409a0df13f82003999">XSM_MAX_VCCAUX</a>, <a class="el" href="group___overview.html#gaf3acf3098ee563aa1cc3e35555d4e801">XSM_MIN_TEMP</a>, <a class="el" href="group___overview.html#gabf3015adb8b42e4b09d5ef8634558852">XSM_MIN_VCCAUX</a>, <a class="el" href="group___overview.html#ga7a2f95ce30a1155b39edd9384e6d898a">XSM_SEQ_CH_AUX00</a>, <a class="el" href="group___overview.html#gaee1c4b7f6daf995c00e384a844581230">XSM_SEQ_CH_AUX15</a>, <a class="el" href="group___overview.html#ga4fed5630d5bcefd6b2c8b4692a5cb579">XSM_SEQ_CH_TEMP</a>, <a class="el" href="group___overview.html#ga5426b215d0d905d01876ba679f08fbe5">XSM_SEQ_CH_VCCAUX</a>, <a class="el" href="group___overview.html#ga090e870886f3ed8d58efc57c763772f2">XSM_SEQ_MODE_CONTINPASS</a>, <a class="el" href="group___overview.html#ga223c74befcd8a6710ea7a7acbaf41636">XSM_SEQ_MODE_SAFE</a>, <a class="el" href="group___overview.html#gac10ed891373f4799aa33110441cb5595">XSM_SR_EOS_MASK</a>, <a class="el" href="group___overview.html#ga04de4a4efc9fab7a41b88166bbffc615">XSysMon_CfgInitialize()</a>, <a class="el" href="group___overview.html#ga07ab2025481799032cd40ff62f4b10f6">XSysMon_GetAdcData()</a>, <a class="el" href="group___overview.html#ga2220b73838f1d10b79b688d1a8ce4c03">XSysMon_GetAlarmOutputStatus()</a>, <a class="el" href="group___overview.html#ga15022394c1ba90705c3227f6cfa0f892">XSysMon_GetMinMaxMeasurement()</a>, <a class="el" href="group___overview.html#ga34d731dace546db3397741f0d229cb3b">XSysMon_GetStatus()</a>, <a class="el" href="group___overview.html#gaf2f837d4a34ab56e268078a2874389d4">XSysMon_LookupConfig()</a>, <a class="el" href="group___overview.html#ga251f2e509945b445a655fbc885f6a934">XSysMon_RawToTemperature</a>, <a class="el" href="group___overview.html#ga23b6bce798cabbee7cb637d36edd54da">XSysMon_SelfTest()</a>, <a class="el" href="group___overview.html#ga3c119682ea951295d41462e329da881a">XSysMon_SetAdcClkDivisor()</a>, <a class="el" href="group___overview.html#ga458e2807135bef154d249e80b145520a">XSysMon_SetAlarmEnables()</a>, <a class="el" href="group___overview.html#gaf9d2de8d4141ae1e7e073ea296df739d">XSysMon_SetAlarmThreshold()</a>, <a class="el" href="group___overview.html#gaf3504732dccf017f38fa7ffd7483f358">XSysMon_SetAvg()</a>, <a class="el" href="group___overview.html#gaeafd06e40eff4807b362edf043d725e8">XSysMon_SetSeqAcqTime()</a>, <a class="el" href="group___overview.html#gae7072bfa213b7318fcc29408a459c0bb">XSysMon_SetSeqAvgEnables()</a>, <a class="el" href="group___overview.html#ga60d92b3a70aab326364319b3d1f1a7cc">XSysMon_SetSeqChEnables()</a>, <a class="el" href="group___overview.html#ga3d3d8052fae049f4ca772b5956ced31f">XSysMon_SetSeqInputMode()</a>, and <a class="el" href="group___overview.html#ga433e353cd5a25454ce2a6da51494e478">XSysMon_SetSequencerMode()</a>.</p>

<p>Referenced by <a class="el" href="xsysmon__polled__example_8c.html#a840291bc02cba5474a4cb46a9b9566fe">main()</a>.</p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
	<p class="footer">&copy; Copyright 2015-2022 Xilinx, Inc. All Rights Reserved.</p>
	<p class="footer">&copy; Copyright 2022-2023 Advanced Micro Devices, Inc. All Rights Reserved.</p>
</div>
</body>
</html>
